<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的关注 - 学生知识管理系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #333;
        }

        .navbar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 0;
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2rem;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: #667eea;
            text-decoration: none;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 2rem;
        }

        .nav-links a {
            text-decoration: none;
            color: #333;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .nav-links a:hover {
            color: #667eea;
        }

        .container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 2rem;
            display: flex;
            gap: 2rem;
        }

        .sidebar {
            width: 250px;
            background: white;
            border-radius: 15px;
            padding: 2rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            height: fit-content;
        }

        .profile-avatar {
            text-align: center;
            margin-bottom: 2rem;
        }

        .avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            font-weight: bold;
            margin: 0 auto 1rem;
        }

        .sidebar-menu {
            list-style: none;
        }

        .sidebar-menu li {
            margin-bottom: 0.5rem;
        }

        .sidebar-menu a {
            display: block;
            padding: 0.75rem 1rem;
            text-decoration: none;
            color: #666;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .sidebar-menu a:hover,
        .sidebar-menu a.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }

        .main-content {
            flex: 1;
            background: white;
            border-radius: 15px;
            padding: 2rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .page-header {
            margin-bottom: 2rem;
        }

        .page-title {
            font-size: 2rem;
            color: #333;
            margin-bottom: 0.5rem;
        }

        .page-subtitle {
            color: #666;
            font-size: 1.1rem;
        }

        .follows-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .follow-card {
            background: #f8f9fa;
            border-radius: 15px;
            padding: 1.5rem;
            transition: all 0.3s ease;
            border: 1px solid #e9ecef;
            text-align: center;
        }

        .follow-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .follow-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            font-weight: bold;
            margin: 0 auto 1rem;
        }

        .follow-name {
            font-size: 1.2rem;
            font-weight: bold;
            color: #333;
            margin-bottom: 0.5rem;
        }

        .follow-username {
            color: #666;
            font-size: 0.9rem;
            margin-bottom: 1rem;
        }

        .follow-stats {
            display: flex;
            justify-content: space-around;
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }

        .stat-item {
            text-align: center;
        }

        .stat-number {
            font-weight: bold;
            color: #667eea;
        }

        .stat-label {
            color: #666;
            font-size: 0.8rem;
        }

        .follow-bio {
            color: #666;
            font-size: 0.9rem;
            line-height: 1.4;
            margin-bottom: 1rem;
            min-height: 2.8rem;
        }

        .follow-actions {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
        }

        .btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }

        .btn-secondary {
            background: #6c757d;
        }

        .btn-secondary:hover {
            box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
        }

        .btn-danger {
            background: #dc3545;
        }

        .btn-danger:hover {
            box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
        }

        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: #666;
        }

        .empty-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
        }

        .alert {
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1rem;
        }

        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .coming-soon {
            text-align: center;
            padding: 4rem 2rem;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
            border-radius: 15px;
            margin: 2rem 0;
        }

        .coming-soon-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
        }

        .coming-soon h3 {
            color: #667eea;
            margin-bottom: 1rem;
        }

        .coming-soon p {
            color: #666;
            line-height: 1.6;
        }

        .feature-list {
            list-style: none;
            margin-top: 2rem;
            text-align: left;
            max-width: 400px;
            margin-left: auto;
            margin-right: auto;
        }

        .feature-list li {
            padding: 0.5rem 0;
            color: #666;
        }

        .feature-list li:before {
            content: "✨";
            margin-right: 0.5rem;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="nav-container">
            <a href="/" class="logo">📚 学生知识管理系统</a>
            <ul class="nav-links">
                <li><a href="/">🏠 首页</a></li>
                <li><a href="/articles">📝 文章</a></li>
                <li><a href="/categories">📂 分类</a></li>
                <li><a href="/profile">👤 个人中心</a></li>
                <li><a href="/logout">🚪 退出</a></li>
            </ul>
        </div>
    </nav>

    <div class="container">
        <!-- 侧边栏 -->
        <aside class="sidebar">
            <div class="profile-avatar">
                <div class="avatar" th:if="${user.avatar == null}" th:text="${user.nickname != null ? user.nickname.substring(0,1) : user.username.substring(0,1)}">U</div>
                <img th:if="${user.avatar != null}" th:src="${user.avatar}" alt="用户头像" class="avatar" style="width: 60px; height: 60px; border-radius: 50%; object-fit: cover;">
                <h3 th:text="${user.nickname != null ? user.nickname : user.username}">用户名</h3>
            </div>
            <ul class="sidebar-menu">
                <li><a href="/profile">📝 个人资料</a></li>
                <li><a href="/profile/avatar">🖼️ 头像管理</a></li>
                <li><a href="/profile/points">⭐ 积分管理</a></li>
                <li><a href="/profile/articles">📚 我的文章</a></li>
                <li><a href="/profile/favorites">❤️ 我的收藏</a></li>
                <li><a href="/profile/follows" class="active">👥 我的关注</a></li>
                <li><a href="/profile/messages">💬 消息中心</a></li>
            </ul>
        </aside>

        <!-- 主要内容 -->
        <main class="main-content">
            <div class="page-header">
                <h1 class="page-title">👥 我的关注</h1>
                <p class="page-subtitle">管理您关注的用户和内容创作者</p>
            </div>

            <!-- 错误信息 -->
            <div th:if="${error}" class="alert alert-error">
                <span th:text="${error}"></span>
            </div>

            <!-- 功能开发中提示 -->
            <div class="coming-soon">
                <div class="coming-soon-icon">🚧</div>
                <h3>关注功能开发中</h3>
                <p>我们正在努力开发用户关注功能，敬请期待！</p>
                
                <ul class="feature-list">
                    <li>关注感兴趣的用户</li>
                    <li>查看关注用户的最新动态</li>
                    <li>接收关注用户的文章更新</li>
                    <li>互相关注建立社交网络</li>
                    <li>推荐相似兴趣的用户</li>
                </ul>
            </div>

            <!-- 关注列表（当功能实现后使用） -->
            <div th:if="${follows != null and !follows.isEmpty()}" style="display: none;">
                <div class="follows-grid">
                    <div class="follow-card" th:each="follow : ${follows}">
                        <div class="follow-avatar" th:text="${follow.nickname != null ? follow.nickname.substring(0,1) : follow.username.substring(0,1)}">U</div>
                        
                        <div class="follow-name" th:text="${follow.nickname != null ? follow.nickname : follow.username}">用户名</div>
                        <div class="follow-username" th:text="'@' + ${follow.username}">@username</div>
                        
                        <div class="follow-stats">
                            <div class="stat-item">
                                <div class="stat-number">0</div>
                                <div class="stat-label">文章</div>
                            </div>
                            <div class="stat-item">
                                <div class="stat-number">0</div>
                                <div class="stat-label">粉丝</div>
                            </div>
                            <div class="stat-item">
                                <div class="stat-number" th:text="${follow.points ?: 0}">0</div>
                                <div class="stat-label">积分</div>
                            </div>
                        </div>
                        
                        <div class="follow-bio" th:text="${follow.bio ?: '这个用户很神秘，什么都没有留下...'}">用户简介</div>
                        
                        <div class="follow-actions">
                            <a href="#" class="btn">查看主页</a>
                            <button class="btn btn-danger">取消关注</button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 空状态（当功能实现后使用） -->
            <div th:if="${follows != null and follows.isEmpty()}" class="empty-state" style="display: none;">
                <div class="empty-icon">👥</div>
                <h3>还没有关注任何人</h3>
                <p>去发现一些有趣的用户并关注他们吧！</p>
                <a href="/articles" class="btn" style="margin-top: 1rem;">发现用户</a>
            </div>
        </main>
    </div>
</body>
</html>